package com.example.gfsquadwebviewproject.util;

import android.content.Context;
import android.util.Log;

import com.example.gfsquadwebviewproject.log.WriteFileLog;
import com.example.gfsquadwebviewproject.m_enum.GlobalHodler;
import com.example.gfsquadwebviewproject.m_enum.GlobalObject;

public class L {
    static private WriteFileLog writeFileLog;
    static private GlobalHodler globalHodler;

    static public void d(String TAG,String msg){
        Log.d(TAG,msg);
    }

    static public void e(String TAG,String msg){
        Log.e(TAG,msg);
    }

    static public void v(String TAG,String msg){
        Log.v(TAG,msg);
    }

    static public void i(String TAG,String msg){
        Log.i(TAG,msg);
    }

    static public void wf(String TAG,String msg){
        d(TAG,msg);

        try {
            if (writeFileLog == null) {
                globalHodler = GlobalHodler.instance();
                writeFileLog = new WriteFileLog( (Context)globalHodler.getHashMap(GlobalObject.CONTEXT) );
                globalHodler = null;
            }
            writeFileLog.writeLog("\n"+TAG+","+TimeUtils.getTime()+":\n"+msg);
        }
        catch (Exception e){
            d(TAG,"wf error:"+e);
        }

    }

}
